#include <bits/stdc++.h>

using namespace std;

int main(int argc, char const *argv[])
{
    int n;scanf("%d",&n);
    vector<int> v(n);
    for (size_t i = 0; i < n; ++i)
    {
        scanf("%d",&v[i]);
    }
    int cnt=1;
    for (size_t i = 1; i < n; ++i)
    {
        if(v[i]!=v[i-1]){
            ++cnt;
        }
    }
    printf("%d\n",cnt);
    
	return 0;
}